package tool.analyzer

import tool.analyzer.Symbols._
import tool.analyzer.Types._

import scala.collection.mutable._

object InitialSymbols {
	var classes : HashMap[String, ClassSymbol] = new HashMap[String, ClassSymbol]

	var toolException: ClassSymbol = new ClassSymbol("ToolException"){
		// getMsg method, everything is empty
		methods("getMessage") = new MethodSymbol("getMessage", toolException)

		// setMsg method
		methods("setMessage") = new MethodSymbol("setMessage", toolException){
			params("msg") = new VariableSymbol("msg").setType(TString)
			argList = List(params("msg"))
		}
  
        members("msg") = new VariableSymbol("msg").setType(TString)
	}

	classes("ToolException") = toolException
	classes("ToolException").methods("setMessage").setType(TObject(toolException))
	classes("ToolException").methods("getMessage").setType(TString)
}
